package leetcode.jianzhioffer;

/**
 * @program: datastructureandalogorithm
 * @description:
 * @author: hmx
 * @create: 2021-11-09 23:33
 **/
public class JianZhiOffer65 {

    public int add(int a, int b) {
        while (b != 0) {
            //保存进位
            int c = (a & b) << 1;
            a ^= b;
            b = c;
        }
        return a;
    }

}
